#include "config.hpp"
#include "dataManger.hpp"
#include "hotManger.hpp"
#include "userManger.hpp"
#include"Server.hpp"
void test1()
{
    std::cout << "serverIp: " << Cloud::Config::getInstance().serverIp() << std::endl;
    std::cout << "serverPort: " << Cloud::Config::getInstance().serverPort() << std::endl;
    std::cout << "hotTime: " << Cloud::Config::getInstance().hotTime() << std::endl;
    std::cout << "urlPrefix: " << Cloud::Config::getInstance().urlPrefix() << std::endl;
    std::cout << "backupFilePath: " << Cloud::Config::getInstance().backupFilePath() << std::endl;
    std::cout << "suffixName: " << Cloud::Config::getInstance().suffixName() << std::endl;
    std::cout << "compressFilePath: " << Cloud::Config::getInstance().compressFilePath() << std::endl;
    std::cout << "userName: " << Cloud::Config::getInstance().userName() << std::endl;
    std::cout << "password: " << Cloud::Config::getInstance().password() << std::endl;
    std::cout << "database: " << Cloud::Config::getInstance().database() << std::endl;
    std::cout << "userTableName: " << Cloud::Config::getInstance().userTableName() << std::endl;
    std::cout << "host: " << Cloud::Config::getInstance().host() << std::endl;
    std::cout << "port: " << Cloud::Config::getInstance().port() << std::endl;
}
void test2()
{
    Cloud::DataManger dm("test");
    Cloud::blackupFileMsg f1("./cloud.json", "./xxxx/cloud.json.bun");
    dm.insert(f1);
}
void test3()
{
    Cloud::DataManger dm("test");
    Cloud::HotManger hm(&dm, "./backup/", "./compress/");
    hm();
}
void test4()
{
    Cloud::UserNode un1("Hero","12345");

    Cloud::UserManger::getInstance().insert(un1);
    while(1);
}
void test5()
{
    Cloud::Server s1;
    s1();

}
void test6()
{
    Cloud::fileUtil f1("./httplib.h");
    bool ret=f1.compress("./Backup/httplib.h.bun");
    std::cout<<ret<<std::endl;
}
int main()
{
    // test1();
    // test2();
    //test3();
    test5();
    return 0;
}
